import { getBlogSettingsDetail } from "@/api/frontend/blogsettings";
import { showMessage } from "@/composables/utils";
import { defineStore } from "pinia";
import { reactive, ref } from "vue";

export const useBlogSettingsStore = defineStore('blogsettings', () => {
    // 博客设置信息
    const blogSettings = ref({})

    // 获取博客设置信息
    function getBlogSettings() {
        // 调用后台获取博客设置接口
        getBlogSettingsDetail().then((res) => {
            if (res.success == true) {
                blogSettings.value = res.data
            } else {
                let message = res.message
                showMessage(message, 'error')
            }
        })
    }

    return { blogSettings, getBlogSettings }
})